package com.rojored.utils 
{

import org.flexunit.assertThat;
import org.hamcrest.object.equalTo;

/**
 *  Tests for average
 */
public class TestAverage 
{

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor
     */
    public function TestAverage() 
    {
        super();
    }

    //--------------------------------------------------------------------------
    //
    //  Methods
    //
    //--------------------------------------------------------------------------

    [Test(description="Test basic average usage")]

    /**
     *  Test basic average usage
     */
    public function simpleArithmeticMeanCases():void
    {
        var twoAndEight:Vector.<Number> = Vector.<Number>([2, 8])
        assertThat(
            "the arithmetic mean of 2 and 8 is 5",
            MathUtil.arithmeticMean(twoAndEight), equalTo(5));

        var twoEightAndEleven:Vector.<Number> = Vector.<Number>([2, 8, 11])
        assertThat(
            "the arithmetic mean of 2, 8  and 11 is 7",
            MathUtil.arithmeticMean(twoEightAndEleven), equalTo(7));
    }
}
}
